package com.office.forum.manage.comments.domain;

import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.office.common.core.domain.BaseEntity;
import com.office.forum.manage.article.domain.ForumPosts;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.office.common.annotation.Excel;

/**
 * 论坛评论对象 forum_comments
 *
 * @author ruoyi
 * @date 2025-05-17
 */
public class ForumComments extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 评论ID */
    private Long commentId;

    /** 关联的帖子ID */
    @Excel(name = "关联的帖子ID")
    private Long postId;

    /** 评论人用户ID */
    @Excel(name = "评论人用户ID")
    private Long userId;

    /**评论人名称*/
    @Excel(name = "评论人名称")
    private String userName;
    /** 评论内容 */
    @Excel(name = "评论内容")
    private String content;

    /** 评论时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "评论时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    /** 最后更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;

    /** 父级评论ID，如果是顶级评论则为NULL */
    @Excel(name = "父级评论ID，如果是顶级评论则为NULL")
    private Long parentCommentId;

    /** 评论状态: 1=正常, 0=待审核, -1=已删除 */
    @Excel(name = "评论状态: 1=正常, 0=待审核, -1=已删除")
    private Long status;

    private List<ForumComments> child;    // 本评论下的子评论

    private ForumPosts forumPosts;

    public ForumPosts getForumPosts() {
        return forumPosts;
    }

    public void setForumPosts(ForumPosts forumPosts) {
        this.forumPosts = forumPosts;
    }

    public List<ForumComments> getChild() {
        return child;
    }

    public void setChild(List<ForumComments> child) {
        this.child = child;
    }

    public void setCommentId(Long commentId)
    {
        this.commentId = commentId;
    }

    public Long getCommentId()
    {
        return commentId;
    }

    public void setPostId(Long postId)
    {
        this.postId = postId;
    }

    public Long getPostId()
    {
        return postId;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public String getContent()
    {
        return content;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public void setUpdatedAt(Date updatedAt)
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt()
    {
        return updatedAt;
    }

    public void setParentCommentId(Long parentCommentId)
    {
        this.parentCommentId = parentCommentId;
    }

    public Long getParentCommentId()
    {
        return parentCommentId;
    }

    public void setStatus(Long status)
    {
        this.status = status;
    }

    public Long getStatus()
    {
        return status;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("commentId", getCommentId())
                .append("postId", getPostId())
                .append("userName", getUserName())
                .append("userId", getUserId())
                .append("content", getContent())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .append("parentCommentId", getParentCommentId())
                .append("status", getStatus())
                .append("forumPosts", getForumPosts())
                .toString();
    }
}